package com.mtcs.www;




public class Text1 {
    public int age;
    public String name;
    public static String classroom;


    public static void func() {

        {
            int a=10;
            System.out.println("普通代码块，定义在方法的内部");
        }
    }
     public Text1(String name,int age){
     this.age=age;
     this.name=name;

     }
    static {
        classroom="高三20班";
        System.out.println("静态代码块-》用于初始化静态成员变量/提前准备一些数据");

    }

    {
        this.name="caocao";
        System.out.println("非静态代码块/实例代码块/构造代码块！-》初始化非静态成员");

    }

    public static void main(String[] args) {
//       Text1 text1=new Text1("mtcs",19);
//        System.out.println(text1.name);
        Text1.func();
    }
}
